//
//  WBDemoViewController.swift
//  迷你微博
//
//  Created by Json on 2020/2/6.
//  Copyright © 2020 Json. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第 \(navigationController?.children.count ?? 0) 个"
    }

    //监听方法
    //继续push一个新的控制器
    @objc private func showNext(){
        let vc = WBDemoViewController()
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension WBDemoViewController{
    
    override func setupTableView() {
        super.setupTableView()
        //设置右侧的控制器
       // navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
        
        //高亮导航
//        let btn: UIButton = UIButton.cz_textButton("下一个", fontSize: 16, normalColor: UIColor.gray, highlightedColor: UIColor.orange)
//        btn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
        
        // 高亮导航抽取
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
}
